package persistence.model;

import persistence.dao.AbstractDAO;

public abstract class AbstractModel {
	private AbstractDAO dao;
	private int id;

	protected AbstractDAO getDao() {
		return dao;
	}

	protected void setDao(AbstractDAO dao) {
		this.dao = dao;
	}

	public void save(int id){
		this.getDao().save(id);
	}
	
	public void save(){
		this.getDao().save();
	}
	
	public void delete(){
		this.getDao().setId(this.getId());
		this.getDao().delete();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

}
